home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / 第1特集Plug-in / Photoshop / LYNXX Plug-In Folder.sit / LYNXX Plug-In Folder / LYNXX.h < prev    next >
Text File  |  1993-10-24  |  6KB  |  179 lines

  1. /*
  2.     File: LYNXX.h
  3.  
  4.     Portions copyright 1990-91 by Thomas Knoll.
  5.  
  6.     This file describes version 4.0 of Photoshop's Acquisition module interface.
  7.     (Small additions by Scott Wurcer 10/93 (at end))
  8. */
  9.  
  10. /* Operation selectors */
  11.  
  12. #define acquireSelectorAbout    0
  13. #define acquireSelectorStart    1
  14. #define acquireSelectorContinue 2
  15. #define acquireSelectorFinish    3
  16. #define acquireSelectorPrepare    4
  17.  
  18. /* Image modes */
  19.  
  20. #define acquireModeBitmap        0
  21. #define acquireModeGrayScale    1
  22. #define acquireModeIndexedColor 2
  23. #define acquireModeRGBColor     3
  24. #define acquireModeCMYKColor    4
  25. #define acquireModeHSLColor     5
  26. #define acquireModeHSBColor     6
  27. #define acquireModeMultichannel 7
  28. #define acquireModeDuotone      8
  29.  
  30. /*    Error return values. The plug-in module may also return standard Macintosh
  31.     operating system error codes, or report its own errors, in which case it
  32.     can return any positive integer. */
  33.  
  34. #define acquireBadParameters    -30000    /* "a problem with the acquisition module interface" */
  35. #define acquireNoScanner        -30001    /* "there is no scanner installed" */
  36. #define acquireScannerProblem    -30002    /* "a problem with the scanner" */
  37.  
  38. typedef unsigned char AcquireLUT [256];
  39.  
  40.  
  41. typedef short AcquireMap [16];
  42.  
  43. typedef struct AcquireMonitor {
  44.  
  45.     Fixed        gamma;                /* Gamma value */
  46.         
  47.     Fixed        redX;                /* Red phosphor */
  48.     Fixed        redY;            
  49.     
  50.     Fixed        greenX;                /* Green phosphor */
  51.     Fixed        greenY;            
  52.  
  53.     Fixed        blueX;                /* Blue phosphor */
  54.     Fixed        blueY;            
  55.  
  56.     Fixed        whiteX;                /* White point */
  57.     Fixed        whiteY;
  58.  
  59.     Fixed        ambient;            /* 0.0 = Low, 0.5 = Medium, 1.0 = High */        
  60.  
  61.     } AcquireMonitor;    
  62.  
  63. typedef struct AcquireRecord {
  64.  
  65.     long        serialNumber;        /* Host's serial number, to allow
  66.                                        copy protected plug-in modules. */
  67.  
  68.     ProcPtr     abortProc;            /* The plug-in module may call this no-argument
  69.                                        BOOLEAN function (using Pascal calling
  70.                                        conventions) several times a second during long
  71.                                        operations to allow the user to abort the operation.
  72.                                        If it returns TRUE, the operation should be aborted
  73.                                        (and a positive error code returned). */
  74.  
  75.     ProcPtr     progressProc;        /* The plug-in module may call this two-argument
  76.                                        procedure (using Pascal calling conventions)
  77.                                        periodically to update a progress indicator.
  78.                                        The first parameter (type LONGINT) is the number
  79.                                        of operations completed; the second (type LONGINT)
  80.                                        is the total number of operations. */
  81.  
  82.     long        maxData;            /* Maximum number of bytes that should be
  83.                                        passed back at once, plus the size of any
  84.                                        interal buffers. The plug-in may reduce this
  85.                                        value in the acquireSelectorPrepare routine. */
  86.  
  87.     short        imageMode;            /* Image mode */
  88.     Point        imageSize;            /* Size of image */
  89.     short        depth;                /* Bits per sample, currently must be 1 or 8 */
  90.     short        planes;             /* Samples per pixel */
  91.  
  92.     Fixed        imageHRes;            /* Pixels per inch */
  93.     Fixed        imageVRes;            /* Pixels per inch */
  94.  
  95.     AcquireLUT    redLUT;             /* Red LUT, only used for Indexed Color images */
  96.     AcquireLUT    greenLUT;            /* Green LUT, only used for Indexed Color images */
  97.     AcquireLUT    blueLUT;            /* Blue LUT, only used for Indexed Color images */
  98.  
  99.     Ptr         data;                /* A pointer to the returned image data. The
  100.                                        plug-in module is now responsible for freeing
  101.                                        this buffer (this is a change from previous
  102.                                        versions). Should be set to NIL when
  103.                                        all the image data has been returned. */
  104.  
  105.     Rect        theRect;            /* Rectangle being returned */
  106.     short        loPlane;            /* First plane being returned */
  107.     short        hiPlane;            /* Last plane being returned */
  108.     short        colBytes;            /* Spacing between columns */
  109.     long        rowBytes;            /* Spacing between rows */
  110.     long        planeBytes;         /* Spacing between planes (ignored if only one
  111.                                        plane is returned at a time) */
  112.  
  113.     Str255        filename;            /* Document file name */
  114.     short        vRefNum;            /* Volume reference number, or zero if none */
  115.     Boolean     dirty;                /* Changes since last saved flag. The plug-in may clear
  116.                                        this field to prevent prompting the user when
  117.                                        closing the document. */
  118.  
  119.     OSType        hostSig;            /* Creator code for host application */
  120.     ProcPtr        hostProc;            /* Host specific callback procedure */
  121.         
  122.     long        hostModes;            /* Used by the host to inform the plug-in which
  123.                                        imageMode values it supports.  If the corresponding
  124.                                        bit (LSB = bit 0) is 1, the mode is supported. */
  125.         
  126.     AcquireMap    planeMap;            /* Maps plug-in plane numbers to host plane
  127.                                        numbers.  The host initializes this is a linear
  128.                                        mapping.  The plug-in may change this mapping if
  129.                                        it sees the data in a different order. */
  130.                                       
  131.     Boolean        canTranspose;        /* Is the host able to transpose the image? */
  132.     Boolean        needTranspose;        /* Does the plug-in need the image transposed? */
  133.                 
  134.     Handle        duotoneInfo;        /* Handle to duotone information, if returning a
  135.                                        duotone mode image.  The plug-in is responsible
  136.                                        for freeing this buffer. */
  137.         
  138.     long        diskSpace;            /* Free disk space on the host's scratch disk or
  139.                                        disks.  Set to a negative number if host does
  140.                                        not use a scratch disk. */
  141.                                       
  142.     ProcPtr        spaceProc;            /* If not NIL, a pointer to a no-argument
  143.                                        LONGINT function (using Pascal calling
  144.                                        conventions) which uses the current settings of
  145.                                        the imageMode, imageSize, depth, and planes
  146.                                        fields to compute the amount of scratch disk
  147.                                        space required to hold the image.  Returns -1
  148.                                        if the settings are not valid. */
  149.                                       
  150.     AcquireMonitor    monitor;        /* Information on current monitor */
  151.  
  152.     char        reserved [256];        /* Set to zero */
  153.  
  154.     } AcquireRecord, *AcquireRecordPtr;
  155.  
  156. #define Length(string) (*(unsigned char *)(string))
  157.  
  158.             /* These are all the defines I needed to add */ 
  159.             
  160.                 
  161. #define NUMCOL 192
  162. #define NUMROW 165
  163.     
  164. typedef short **short_H;
  165.     
  166.     /* The value of global variables are not preserved between invocations
  167.    of the plug-in, since the plug-in's resource file is closed. To keep
  168.    values around longer, make them part of the following structure. */
  169.  
  170.     typedef struct TPermanent {
  171.     short lastRows;
  172.     short lastCols;
  173.     short lastMode;
  174.     short_H MyImageHandle;    /* I save the image as a relocatable block */
  175.     short maxImageValue;    /* These are for scaling */
  176.     short minImageValue;
  177.     } TPermanent;
  178.  
  179.